package com.r2dbc.common.exception;

import com.r2dbc.common.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import reactor.core.publisher.Mono;

/*
 *@Description<p></p>
 *@Author gz
 *@CreateTime 2025/7/22 11:16
 *@CopyRight @2021-2025 卓望信息技术（北京）公司
 */
@RestControllerAdvice
@Slf4j
public class GlobalExceptionHander {
    @ExceptionHandler(Exception.class)
    public Mono<Result<Object>> handleException(Exception e) {
        log.error("全局异常处理：{}", e.getMessage(), e);
        return Result.error("操作失败，请稍后再试");
    }
}
